﻿@using Kevin.Shop.Business.Service.Entity.Helper

<ul data-role="listview" data-divider-theme="a" data-inset="true">
    <li data-role="list-divider">
        <h1 class="white">商品分类</h1>
    </li>
    @if (WebClientContext.Current.CategorySwitch == WebClientContext.StrGroup)
    {
       <li data-theme="none" data-icon="false">
            <div data-role="collapsible-set" >
                @foreach (var item in Model)
                { 
                    <div data-role="collapsible" >
                        <h2>@item.CategoryName</h2>
                        <ul data-role="listview">
                            @foreach (var subitem in item.CategoryList)
                            { 
                                <li><a  href="~/Sort/SubCategoryList?id=@subitem.CategoryId">@subitem.CategoryName</a></li>
                            }
                        </ul>
                    </div>
                }
            </div>
        </li>
    }else
    {
        <li data-theme="none" data-icon="false">
            <div data-role="collapsible-set" >
                @foreach (var item in Model)
                { 
                    <div data-role="collapsible" >
                        <h2>@item.CategoryName</h2>
                        <ul data-role="listview">
                            @foreach (var subitem in item.CategoryList)
                            { 
                               <li><a  href="~/Product/ProductList?sid=@subitem.CategoryId">@subitem.CategoryName</a></li>
                            }
                        </ul>
                    </div>
                }
            </div>
        </li>
    }
</ul>